<%@ page import="java.util.List" %>
<%@ page import="com.hzit.bean.Emp" %>

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/10/10 0010
  Time: 13:59
  To change this template use File | Settings | File Templates.

  page:表示当前jsp页面的指令，设置页面的属性
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>表格</title>
    <link rel="stylesheet" href="../frame/layui/css/layui.css">
    <link rel="stylesheet" href="../frame/static/css/style.css">
    <link rel="icon" href="../frame/static/image/code.png">
</head>
<body class="body">


<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>默认表格</legend>
</fieldset>

<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-lg8 layui-col-lg-offset2">
            <h1 style="text-align: center">添加员工</h1>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-lg8 layui-col-lg-offset2">

            <%--            添加的服务器:添加servlet--%>
            <form class="layui-form" action="${pageContext.request.contextPath}/emp/update" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">员工编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="empno" required lay-verify="required" placeholder="请输入编号"
                               autocomplete="off" class="layui-input" readonly="readonly" value="${emp.empno}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">员工姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="ename" required lay-verify="required" placeholder="请输入名称"
                               autocomplete="off" class="layui-input" value="${emp.ename}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">工作职位</label>
                    <div class="layui-input-block">
                        <input type="text" name="job" required lay-verify="required" placeholder="请输入职位"
                               autocomplete="off" class="layui-input" value="${emp.job}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">上级编号</label>
                    <div class="layui-input-block">
                        <input type="number" name="mgr" required lay-verify="required" placeholder="上级编号"
                               autocomplete="off" class="layui-input" value="${emp.mgr}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">入职时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="hireDate" required lay-verify="required" placeholder="yyyy-MM-dd"
                               autocomplete="off" class="layui-input" value="${emp.hireDate}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">薪资</label>
                    <div class="layui-input-block">
                        <input type="number" name="sal" required lay-verify="required" placeholder="请输入薪资"
                               autocomplete="off" class="layui-input" value="${emp.sal}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">部门编号</label>
                    <div class="layui-input-block">
                        <input type="number" name="deptno" required lay-verify="required" placeholder="请输入部门编号"
                               autocomplete="off" class="layui-input" value="${emp.deptno}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">确认修改</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

        </div>
    </div>

</div>


<script type="text/javascript" src="../frame/layui/layui.js"></script>
<script type="text/javascript">
    //Demo
    layui.use('form', function () {
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function (data) {
            //layer.msg(JSON.stringify(data.field));
            return true;
        });
    });
</script>
</body>
</html>